package com.mnemonic.test;

import com.mnemonic.game.Game;
import com.mnemonic.level.Levels;
import com.mnemonic.player.Players;
import com.mnemonic.utils.JaxbMapper;

public class GameXml {

    public static void main(String[] args) {
        Game game = Game.newGame(Levels.getLevels().get(0), Players.getPlayers());
        game.burnMine();
        String xml = JaxbMapper.toXml(game);
        System.out.println(xml);
        Game game2 = JaxbMapper.fromXml(xml, Game.class);
        int[][] minemap = game2.getMineMap();
        for (int i = 0; i < minemap.length; i++) {
            for (int j = 0; j < minemap[i].length; j++) {
                System.out.print(minemap[i][j] + ",");
            }
            System.out.println();
        }
    }

}
